/// 城市Data模型类
class CityData {
  final List<CityModel> cityList;

  CityData({
    this.cityList = const <CityModel>[],
  });

  factory CityData.fromList(List<dynamic> list) => CityData(
        cityList: list.isEmpty
            ? []
            : List<CityModel>.from(
                list.map((e) => CityModel.fromJson(e)),
              ),
      );
}

/// 城市模型
class CityModel {
  /// 城市编码
  final String? cityCode;

  /// 城市名称
  final String? cityName;

  /// 地址
  final String? address;

  /// 维度
  final String? latitude;

  /// 经度
  final String? longitude;

  /// ...
  final String? freId;

  /// 客服电话
  final String? servicePhone;

  /// 客服时间
  final String? serviceTime;

  /// ...
  final int? bussStatus;

  /// ...
  final String? accessId;

  CityModel({
    this.cityCode,
    this.cityName,
    this.freId,
    this.address,
    this.latitude,
    this.longitude,
    this.servicePhone,
    this.serviceTime,
    this.accessId,
    this.bussStatus,
  });

  factory CityModel.fromJson(Map<String, dynamic> json) => CityModel(
        cityCode: json["cityCode"],
        cityName: json["cityName"],
        freId: json["freId"],
        address: json["address"],
        latitude: json["latitude"],
        longitude: json["longitude"],
        servicePhone: json["servicePhone"],
        serviceTime: json["serviceTime"],
        accessId: json["accessId"],
        bussStatus: json["bussStatus"],
      );

  Map<String, dynamic> toJson() => {
        "cityCode": cityCode,
        "cityName": cityName,
        "freId": freId,
        "address": address,
        "latitude": latitude,
        "longitude": longitude,
        "servicePhone": servicePhone,
        "serviceTime": serviceTime,
        "accessId": accessId,
        "bussStatus": bussStatus,
      };
}
